package com.wlyuan.index.domain.index.repository.old;


import com.wlyuan.core.domain.valueobj.TenantId;
import com.wlyuan.core.domain.valueobj.WaybillId;
import com.wlyuan.transport.constants.WaybillTypeEnum;
import lombok.RequiredArgsConstructor;

/**
 * @author yuanjie
 */
@RequiredArgsConstructor
public class WaybillIndexId {
    private final WaybillId waybillId;
    private final WaybillTypeEnum type;
    private final TenantId tenantId;

    public Long getId() {
        String stringId = String.format("%d%08d%d", this.type.getValue(), this.tenantId.getId(), this.waybillId.getId());
        return Long.parseLong(stringId);
    }
}
